package com.EAIPClub.ClassesManager.mapper;

import com.api.POJO.ClassesManager.ClassesInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description :课程基本信息Mapper
 * @Author :崔昌赫
 * @Date : 2021/12/12
 */
@Mapper
@Repository
public interface ClassesInfoMapper {

    @Insert("INSERT INTO t_classesinfo VALUES (null,$'{info.uid}','${info.name}','${info.useruid}')")
    Boolean addNewClassesInfo(@Param("info") ClassesInfo info);


    ClassesInfo getClassesInfoByID(Integer ID);
    @Select("SELECT * FROM t_classesinfo WHERE useruid = '${useruid}'")
    List<ClassesInfo> getClassesInfoByUserUid(@Param("useruid") String UserUid);
    ClassesInfo getClassesInfoByUid(String uid);

    Boolean updateClassesInfoByID(Integer ID,ClassesInfo info);
    Boolean updateClassesInfoByUid(String uid,ClassesInfo info);

    Boolean deleteClassesInfoByID(Integer ID);
    @Delete("DELETE FROM t_classesinfo WHERE uid = '${uid}'")
    Boolean deleteClassesInfoByUid(String uid);





}
